package com.sww.pj.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import com.sww.pj.common.pojo.JsonResult;
import com.sww.pj.sys.pojo.SysWlUser;
import com.sww.pj.sys.service.SysWlUserService;

@RestController
@RequestMapping("/user/")
//	外来用户
public class SysWlUserController {

	@Autowired
	private SysWlUserService sysWlUserService;

	@RequestMapping("doFindPageObject")
	public JsonResult doFindPageObject(String username,Long pageCurrent) {

		return new JsonResult(sysWlUserService.findPageObject(username, pageCurrent));
	}

	@RequestMapping("doDeleteObject")
	public JsonResult doDeleteObject(Integer... ids){
		sysWlUserService.deleteObject(ids);
		return new JsonResult("删除成功！");
	}

	@RequestMapping("doSaveObject")
	public JsonResult doSaveObject(SysWlUser entity,Integer[]roleIds) {
		sysWlUserService.saveObject(entity, roleIds);
		return new JsonResult("添加成功！");
	}


	@RequestMapping("doFindObjectById")
	public JsonResult doFindObjectById(Integer id) {
		return new JsonResult(sysWlUserService.findObjectById(id));
	}

	@RequestMapping("doUpdateObject")
	public JsonResult doUpdateObject(SysWlUser entity,Integer[]roleIds) {
		sysWlUserService.updateObject(entity, roleIds);
		return new JsonResult("修改成功！");
	}

}
